﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace ERP.ERPSystem.ProductionSystem.Dto
{
    public class ProductionWorkOrderDto
    {
        /// <summary>
        /// 工单ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 工单编码
        /// </summary>
        [Required(ErrorMessage = "工单编码不能为空")]
        [StringLength(50)]
        public string WorkOrderCode { get; set; }

        /// <summary>
        /// 工单名称
        /// </summary>
        [Required(ErrorMessage = "工单名称不能为空")]
        [StringLength(100)]
        public string WorkOrderName { get; set; }

        /// <summary>
        /// 来源类型
        /// </summary>
        [Required]
        public string SourceType { get; set; }

        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderCode { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public int DocumentStatus { get; set; }

        /// <summary>
        /// 工单类型
        /// </summary>
        [Required]
        public string WorkOrderType { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [Required(ErrorMessage = "产品编号不能为空")]
        [StringLength(50)]
        public string ProductCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [Required(ErrorMessage = "产品名称不能为空")]
        [StringLength(100)]
        public string ProductName { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        [StringLength(100)]
        public string ProductModel { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [StringLength(20)]
        public string Unit { get; set; }

        /// <summary>
        /// 工单数量
        /// </summary>
        [Range(0, int.MaxValue, ErrorMessage = "数量必须大于等于0")]
        public int WorkOrderQuantity { get; set; }

        /// <summary>
        /// 需求日期
        /// </summary>
        public DateTime DemandDate { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [StringLength(50)]
        public string BatchNo { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(500)]
        public string Remark { get; set; }

        /// <summary>
        /// 客户编码
        /// </summary>
        [StringLength(50)]
        public string CustomerCode { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [StringLength(100)]
        public string CustomerName { get; set; }
    }
}
